// #ifdef VUE3
//导入网络请求包
 //##表示还一知半解的
 // 粘性定位 - position: sticky
 // defineEmits(['click']); emit()
 //lodash 工具包
import App from './App.vue'
import store from './store/store.js'
import { createSSRApp } from 'vue'
import { $http } from '@escook/request-miniprogram'

//挂在到全局uni对象
uni.$http = $http
//配置请求根路径
$http.baseUrl = 'https://api-hmugo-web.itheima.net'
// 请求开始前
$http.beforeRequest = function(option){
   uni.showLoading({
     title: 'Loading...'
   })
}
//请求完成后
$http.afterRequest = function(){
  uni.hideLoading();
}
//提示消息封装
uni.$showMsg = function(title = '数据请求失败', duration = 1500){
    uni.showToast({
      title,
      duration,
      icon: "none"
    })
}


export function createApp() {
  const app = createSSRApp(App)
  app.use(store)
  return {
    app
  }
  
}
// #endif




// #ifndef VUE3
import Vue from 'vue'
import App from './App'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App
})
app.$mount()
// #endif
